import type { TreeProps } from 'ant-design-vue';

// ant树选择事件 树数据类型
export type TsTreePropsTreeData = TreeProps['treeData'];
// ant树选择事件 树选择事件类型
export type TsTreePropsSelect = TreeProps['onSelect'];
// ant树选择事件 node类型
export type TsSelectNode = Parameters<Exclude<TreeProps['onSelect'], undefined>>[1]['node'];

export interface TsArrayRecords {
	aiId: number;
	aiName: string;
	deviceId: number;
	deviceName: string;
	eventFile: string;
	eventImg: string;
	eventTime: string;
	eventType: number;
	id: number;
	senceId: number;
	senceName: string;
}
// 播放列表信息

enum TsVideoSpinning {
	loading = 0,
	succeed = 1,
	error = 2
}
export interface TsDeviceIdsItem {
	areaOrDeviceId: number;
	disable: boolean;
	id: string;
	level: number;
	name: string;
	aiSrvCountV2: number;
	aiSrvNameStrV2: string;
	parentId: string;
	status: number;
	type: number;
	webrtc: string;
	spinning: TsVideoSpinning;
	identifyImageList: string;
	areaLinkName: string;
	warningStatus: boolean;
	children: null | TsDeviceIdsItem[];
}
export interface TsCurrentConfigProps {
	aiTagStatus: boolean;
	deviceIds: Array<TsDeviceIdsItem>;
	id: number;
	inspectionStatus: boolean;
	screenType: number;
	userId: number;
	determineList?: Array<boolean>;
}

export interface TsAlarmCenterListProps {
	deviceId: number;
	deviceName: string;
	deviceStatus: number;
	deviceStreamingLocation: string;
	deviceActiveSrvCount: number;
	deviceConcatName: string;
	alarmStatus?: boolean;
	warningStatus?: boolean;
	[attr: string]: any;
}

export interface TsDeviceListProps {
	deviceLocationName: string;
	deviceLocationId: number;
	deviceAlarmCenterList: TsAlarmCenterListProps[];
}

export interface TsImgSrcDataProps {
	deviceId: string | number;
	image: number | string;
}

// 综合态势报警

export type Tsloadings = {
	Statistics: boolean;
	Analysis: boolean;
	Trend: boolean;
	Region: boolean;
	Record: boolean;
};

// 播放列表实例 + 视频的key

export interface TsPlayerQueue {
	play: { close: () => void; destroy: () => void };
	key?: string;
}

// 报警记录列表
export interface TsAlarmList {
	id?: string;
	algorithmName: string;
	mAreaName: string;
	deviceName: string;
	createTime: string;
	imageUrl: string;
	positionName: string;
	content: string;
}

export interface TsEchart {
	name: string;
	value: number | string;
}

export type TsTreeState = {
	expandedKeys: (string | number)[];
	selectedKeys: (string | number)[];
	checkedKeys: (string | number)[];
	treeData: Array<any>;
	flatTreeObj: Record<string, Record<string, any>>;
	autoExpandParent: boolean;
	isshowchecked: boolean;
};

export type TsRightList<T> = {
	selectedList: T;
	selectedKeys: (string | number)[];
};

export type TsTreeCheckedKeys = (string | number)[] | { checked: (string | number)[]; halfChecked: (string | number)[] };
